package com.chinasofti.SSM.controller;

import java.text.SimpleDateFormat;
import java.util.Date;

import org.springframework.beans.propertyeditors.CustomDateEditor;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.InitBinder;

/**
 * 自定义编辑器  --- 实现时间数据无法自动转换绑定
 * @author zp
 *
 */
public class BaseController {
	@InitBinder
	public void initBinder(WebDataBinder dataBinder) {
		System.out.println("initBinder=======================");

		dataBinder.registerCustomEditor(Date.class, new CustomDateEditor(new SimpleDateFormat("yyyy-MM-dd"), true));
	}
}
